package org.taobao.ibatiside.ui.wizard;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.HashMap;
import org.taobao.ibatiside.model.mapperv2.ResultMap;
import org.taobao.ibatiside.ui.util.TypeWrapper;
import java.net.URL;
import org.taobao.ibatiside.ui.util.ClassField;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.modelbase.sql.query.QueryStatement;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.taobao.ibatiside.model.mapperv2.GeneralStatement;
import org.taobao.ibatiside.model.mapperv2.ParameterMap;
import org.taobao.ibatiside.model.mapperv2.SqlMap;
import org.taobao.ibatiside.ui.util.DefaultNamingConversion;
import org.taobao.ibatiside.ui.util.INamingConversion;

public final class BatisSettingModel {

	/**
  *@generated
  */
  public static final String K_OP_SQL = "opSql";
	/**
  *@generated
  */
  private String opSql;

	/**
  *@generated
  */
  public void setOpSql(String value){
    
    Object old_value = this.opSql;
    
    this.opSql = value;
    
    changeSupport.firePropertyChange(K_OP_SQL, old_value, this.opSql);
  }

	/**
  *@generated
  */
  public String getOpSql(){
    
    return this.opSql;
  }

	/**
  *@generated
  */
  public static final String K_DTP_STMT = "dtpStmt";
	/**
  *@generated
  */
  private QueryStatement dtpStmt;

	/**
  *@generated
  */
  public void setDtpStmt(QueryStatement value){
    
    if (this.dtpStmt != null) this.dtpStmt.eAdapters().clear();
    
    Object old_value = this.dtpStmt;
    
    this.dtpStmt = value;
    
    if (this.dtpStmt != null) addEMFListener(this.dtpStmt);
    
    changeSupport.firePropertyChange(K_DTP_STMT, old_value, this.dtpStmt);
  }

	/**
  *@generated
  */
  public QueryStatement getDtpStmt(){
    
    return this.dtpStmt;
  }

	/**
  *@generated
  */
  public static final String K_CONNECTION_PROFILE = "connectionProfile";
	/**
  *@generated
  */
  private IConnectionProfile connectionProfile;

	/**
  *@generated
  */
  public void setConnectionProfile(IConnectionProfile value){
    
    Object old_value = this.connectionProfile;
    
    this.connectionProfile = value;
    
    changeSupport.firePropertyChange(K_CONNECTION_PROFILE, old_value, this.connectionProfile);
  }

	/**
  *@generated
  */
  public IConnectionProfile getConnectionProfile(){
    
    return this.connectionProfile;
  }

	/**
  *@generated
  */
  public static final String K_CONFIGURATION_FILE = "configurationFile";
	/**
  *@generated
  */
  private IFile configurationFile;

	/**
  *@generated
  */
  public void setConfigurationFile(IFile value){
    
    Object old_value = this.configurationFile;
    
    this.configurationFile = value;
    
    changeSupport.firePropertyChange(K_CONFIGURATION_FILE, old_value, this.configurationFile);
  }

	/**
  *@generated
  */
  public IFile getConfigurationFile(){
    
    return this.configurationFile;
  }

	/**
  *@generated
  */
  public static final String K_SQLMAP_FILE = "sqlmapFile";
	/**
  *@generated
  */
  private IFile sqlmapFile;

	/**
  *@generated
  */
  public void setSqlmapFile(IFile value){
    
    Object old_value = this.sqlmapFile;
    
    this.sqlmapFile = value;
    
    changeSupport.firePropertyChange(K_SQLMAP_FILE, old_value, this.sqlmapFile);
  }

	/**
  *@generated
  */
  public IFile getSqlmapFile(){
    
    return this.sqlmapFile;
  }

	/**
  *@generated
  */
  public static final String K_SQLMAP = "sqlmap";
	/**
  *@generated
  */
  private SqlMap sqlmap;

	/**
  *@generated
  */
  public void setSqlmap(SqlMap value){
    
    if (this.sqlmap != null) this.sqlmap.eAdapters().clear();
    
    Object old_value = this.sqlmap;
    
    this.sqlmap = value;
    
    if (this.sqlmap != null) addEMFListener(this.sqlmap);
    
    changeSupport.firePropertyChange(K_SQLMAP, old_value, this.sqlmap);
  }

	/**
  *@generated
  */
  public SqlMap getSqlmap(){
    
    return this.sqlmap;
  }

	/**
  *@generated
  */
  public static final String K_STATEMENT = "statement";
	/**
  *@generated
  */
  private GeneralStatement statement;

	/**
  *@generated
  */
  public void setStatement(GeneralStatement value){
    
    if (this.statement != null) this.statement.eAdapters().clear();
    
    Object old_value = this.statement;
    
    this.statement = value;
    
    if (this.statement != null) addEMFListener(this.statement);
    
    changeSupport.firePropertyChange(K_STATEMENT, old_value, this.statement);
  }

	/**
  *@generated
  */
  public GeneralStatement getStatement(){
    
    return this.statement;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_NEED_CREATE = "beanNeedCreate";
	/**
  *@generated
  */
  private boolean beanNeedCreate;

	/**
  *@generated
  */
  public void setBeanNeedCreate(boolean value){
    
    Object old_value = this.beanNeedCreate;
    
    this.beanNeedCreate = value;
    
    changeSupport.firePropertyChange(K_BEAN_NEED_CREATE, old_value, this.beanNeedCreate);
  }

	/**
  *@generated
  */
  public boolean getBeanNeedCreate(){
    
    return this.beanNeedCreate;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_FIELDS = "beanFields";
	/**
  *@generated
  */
  private List<DataObjectField> beanFields;

	/**
  *@generated
  */
  public void setBeanFields(List<DataObjectField> value){
     
    if (this.beanFields != null) this.beanFields.clear();
    
    this.beanFields = value;
    
    changeSupport.firePropertyChange(K_BEAN_FIELDS, null, this.beanFields);
  }

	/**
  *@generated
  */
  public List<DataObjectField> getBeanFields(){
    
    if(beanFields == null){
      beanFields = new LinkedList<DataObjectField>();
    }
    
    return this.beanFields;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_FIELDS_ADD = "beanFields.insert";
	/**
  *@generated
  */
  public static final String K_BEAN_FIELDS_REMOVE = "beanFields.remove";

	/**
  *@generated
  */
  public void beanFieldsInsert(DataObjectField value){
    beanFields.add(value);
    changeSupport.firePropertyChange(K_BEAN_FIELDS_ADD,null,value);
  }

	/**
  *@generated
  */
  public void beanFieldsRemove(DataObjectField value){
   beanFields.remove(value);
   changeSupport.firePropertyChange(K_BEAN_FIELDS_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_BEAN_PATH = "beanPath";
	/**
  *@generated
  */
  private IPath beanPath;

	/**
  *@generated
  */
  public void setBeanPath(IPath value){
    
    Object old_value = this.beanPath;
    
    this.beanPath = value;
    
    changeSupport.firePropertyChange(K_BEAN_PATH, old_value, this.beanPath);
  }

	/**
  *@generated
  */
  public IPath getBeanPath(){
    
    return this.beanPath;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_TEMPLATE = "beanTemplate";
	/**
  *@generated
  */
  private URL beanTemplate;

	/**
  *@generated
  */
  public void setBeanTemplate(URL value){
    
    Object old_value = this.beanTemplate;
    
    this.beanTemplate = value;
    
    changeSupport.firePropertyChange(K_BEAN_TEMPLATE, old_value, this.beanTemplate);
  }

	/**
  *@generated
  */
  public URL getBeanTemplate(){
    
    return this.beanTemplate;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_TEMPLATES = "beanTemplates";
	/**
  *@generated
  */
  private List<URL> beanTemplates;

	/**
  *@generated
  */
  public void setBeanTemplates(List<URL> value){
     
    if (this.beanTemplates != null) this.beanTemplates.clear();
    
    this.beanTemplates = value;
    
    changeSupport.firePropertyChange(K_BEAN_TEMPLATES, null, this.beanTemplates);
  }

	/**
  *@generated
  */
  public List<URL> getBeanTemplates(){
    
    if(beanTemplates == null){
      beanTemplates = new LinkedList<URL>();
    }
    
    return this.beanTemplates;
  }

	/**
  *@generated
  */
  public static final String K_BEAN_TEMPLATES_ADD = "beanTemplates.insert";
	/**
  *@generated
  */
  public static final String K_BEAN_TEMPLATES_REMOVE = "beanTemplates.remove";

	/**
  *@generated
  */
  public void beanTemplatesInsert(URL value){
    beanTemplates.add(value);
    changeSupport.firePropertyChange(K_BEAN_TEMPLATES_ADD,null,value);
  }

	/**
  *@generated
  */
  public void beanTemplatesRemove(URL value){
   beanTemplates.remove(value);
   changeSupport.firePropertyChange(K_BEAN_TEMPLATES_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_BEAN_DESCRIPTION = "beanDescription";
	/**
  *@generated
  */
  private String beanDescription;

	/**
  *@generated
  */
  public void setBeanDescription(String value){
    
    Object old_value = this.beanDescription;
    
    this.beanDescription = value;
    
    changeSupport.firePropertyChange(K_BEAN_DESCRIPTION, old_value, this.beanDescription);
  }

	/**
  *@generated
  */
  public String getBeanDescription(){
    
    return this.beanDescription;
  }
	/**
  *@generated
  */
  public static final String K_PARAMETER_REQUIRED = "parameterRequired";
	/**
  *@generated
  */
  private boolean parameterRequired;

	/**
  *@generated
  */
  public void setParameterRequired(boolean value){
    
    Object old_value = this.parameterRequired;
    
    this.parameterRequired = value;
    
    changeSupport.firePropertyChange(K_PARAMETER_REQUIRED, old_value, this.parameterRequired);
  }

	/**
  *@generated
  */
  public boolean getParameterRequired(){
    
    return this.parameterRequired;
  }

	/**
  *@generated
  */
  public static final String K_RESULT_REQUIRED = "resultRequired";
	/**
  *@generated
  */
  private boolean resultRequired;

	/**
  *@generated
  */
  public void setResultRequired(boolean value){
    
    Object old_value = this.resultRequired;
    
    this.resultRequired = value;
    
    changeSupport.firePropertyChange(K_RESULT_REQUIRED, old_value, this.resultRequired);
  }

	/**
  *@generated
  */
  public boolean getResultRequired(){
    
    return this.resultRequired;
  }

	/**
  *@generated
  */
  public static final String K_PARAMETER_USE_CLASS = "parameterUseClass";
	/**
  *@generated
  */
  private boolean parameterUseClass;

	/**
  *@generated
  */
  public void setParameterUseClass(boolean value){
    
    Object old_value = this.parameterUseClass;
    
    this.parameterUseClass = value;
    
    changeSupport.firePropertyChange(K_PARAMETER_USE_CLASS, old_value, this.parameterUseClass);
  }

	/**
  *@generated
  */
  public boolean getParameterUseClass(){
    
    return this.parameterUseClass;
  }

	/**
  *@generated
  */
  public static final String K_PARAMETER_CLASS = "parameterClass";
	/**
  *@generated
  */
  private TypeWrapper parameterClass;

	/**
  *@generated
  */
  public void setParameterClass(TypeWrapper value){
    
    Object old_value = this.parameterClass;
    
    this.parameterClass = value;
    
    changeSupport.firePropertyChange(K_PARAMETER_CLASS, old_value, this.parameterClass);
  }

	/**
  *@generated
  */
  public TypeWrapper getParameterClass(){
    
    return this.parameterClass;
  }

	/**
  *@generated
  */
  public static final String K_ACTIVE_CLASS_FIELDS = "activeClassFields";
	/**
  *@generated
  */
  private List<ClassField> activeClassFields;

	/**
  *@generated
  */
  public void setActiveClassFields(List<ClassField> value){
     
    if (this.activeClassFields != null) this.activeClassFields.clear();
    
    this.activeClassFields = value;
    
    changeSupport.firePropertyChange(K_ACTIVE_CLASS_FIELDS, null, this.activeClassFields);
  }

	/**
  *@generated
  */
  public List<ClassField> getActiveClassFields(){
    
    if(activeClassFields == null){
      activeClassFields = new LinkedList<ClassField>();
    }
    
    return this.activeClassFields;
  }

	/**
  *@generated
  */
  public static final String K_ACTIVE_CLASS_FIELDS_ADD = "activeClassFields.insert";
	/**
  *@generated
  */
  public static final String K_ACTIVE_CLASS_FIELDS_REMOVE = "activeClassFields.remove";

	/**
  *@generated
  */
  public void activeClassFieldsInsert(ClassField value){
    activeClassFields.add(value);
    changeSupport.firePropertyChange(K_ACTIVE_CLASS_FIELDS_ADD,null,value);
  }

	/**
  *@generated
  */
  public void activeClassFieldsRemove(ClassField value){
   activeClassFields.remove(value);
   changeSupport.firePropertyChange(K_ACTIVE_CLASS_FIELDS_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_PARAMETER_MAP = "parameterMap";
	/**
  *@generated
  */
  private ParameterMap parameterMap;

	/**
  *@generated
  */
  public void setParameterMap(ParameterMap value){
    
    if (this.parameterMap != null) this.parameterMap.eAdapters().clear();
    
    Object old_value = this.parameterMap;
    
    this.parameterMap = value;
    
    if (this.parameterMap != null) addEMFListener(this.parameterMap);
    
    changeSupport.firePropertyChange(K_PARAMETER_MAP, old_value, this.parameterMap);
  }

	/**
  *@generated
  */
  public ParameterMap getParameterMap(){
    
    return this.parameterMap;
  }

	/**
  *@generated
  */
  public static final String K_RESULT_USE_CLASS = "resultUseClass";
	/**
  *@generated
  */
  private boolean resultUseClass;

	/**
  *@generated
  */
  public void setResultUseClass(boolean value){
    
    Object old_value = this.resultUseClass;
    
    this.resultUseClass = value;
    
    changeSupport.firePropertyChange(K_RESULT_USE_CLASS, old_value, this.resultUseClass);
  }

	/**
  *@generated
  */
  public boolean getResultUseClass(){
    
    return this.resultUseClass;
  }

	/**
  *@generated
  */
  public static final String K_RESULT_CLASS = "resultClass";
	/**
  *@generated
  */
  private TypeWrapper resultClass;

	/**
  *@generated
  */
  public void setResultClass(TypeWrapper value){
    
    Object old_value = this.resultClass;
    
    this.resultClass = value;
    
    changeSupport.firePropertyChange(K_RESULT_CLASS, old_value, this.resultClass);
  }

	/**
  *@generated
  */
  public TypeWrapper getResultClass(){
    
    return this.resultClass;
  }

	/**
  *@generated
  */
  public static final String K_RESULT_MAP = "resultMap";
	/**
  *@generated
  */
  private ResultMap resultMap;

	/**
  *@generated
  */
  public void setResultMap(ResultMap value){
    
    if (this.resultMap != null) this.resultMap.eAdapters().clear();
    
    Object old_value = this.resultMap;
    
    this.resultMap = value;
    
    if (this.resultMap != null) addEMFListener(this.resultMap);
    
    changeSupport.firePropertyChange(K_RESULT_MAP, old_value, this.resultMap);
  }

	/**
  *@generated
  */
  public ResultMap getResultMap(){
    
    return this.resultMap;
  }

	/**
  *@generated
  */
  public static final String K_DAO_PAGE_REQUIRED = "daoPageRequired";
	/**
  *@generated
  */
  private boolean daoPageRequired;

	/**
  *@generated
  */
  public void setDaoPageRequired(boolean value){
    
    Object old_value = this.daoPageRequired;
    
    this.daoPageRequired = value;
    
    changeSupport.firePropertyChange(K_DAO_PAGE_REQUIRED, old_value, this.daoPageRequired);
  }

	/**
  *@generated
  */
  public boolean getDaoPageRequired(){
    
    return this.daoPageRequired;
  }

	/**
  *@generated
  */
  public static final String K_BEAUTIFIER_XML = "beautifierXml";
	/**
  *@generated
  */
  private boolean beautifierXml;

	/**
  *@generated
  */
  public void setBeautifierXml(boolean value){
    
    Object old_value = this.beautifierXml;
    
    this.beautifierXml = value;
    
    changeSupport.firePropertyChange(K_BEAUTIFIER_XML, old_value, this.beautifierXml);
  }

	/**
  *@generated
  */
  public boolean getBeautifierXml(){
    
    return this.beautifierXml;
  }

	/**
  *@generated
  */
  public static final String K_DAO_INTERFACE_TEMPLATE = "daoInterfaceTemplate";
	/**
  *@generated
  */
  private URL daoInterfaceTemplate;

	/**
  *@generated
  */
  public void setDaoInterfaceTemplate(URL value){
    
    Object old_value = this.daoInterfaceTemplate;
    
    this.daoInterfaceTemplate = value;
    
    changeSupport.firePropertyChange(K_DAO_INTERFACE_TEMPLATE, old_value, this.daoInterfaceTemplate);
  }

	/**
  *@generated
  */
  public URL getDaoInterfaceTemplate(){
    
    return this.daoInterfaceTemplate;
  }

	/**
  *@generated
  */
  public static final String K_DAO_IMPL_TEMPLATE = "daoImplTemplate";
	/**
  *@generated
  */
  private URL daoImplTemplate;

	/**
  *@generated
  */
  public void setDaoImplTemplate(URL value){
    
    Object old_value = this.daoImplTemplate;
    
    this.daoImplTemplate = value;
    
    changeSupport.firePropertyChange(K_DAO_IMPL_TEMPLATE, old_value, this.daoImplTemplate);
  }

	/**
  *@generated
  */
  public URL getDaoImplTemplate(){
    
    return this.daoImplTemplate;
  }

	/**
  *@generated
  */
  public static final String K_SPRING_TEMPLATE = "springTemplate";
	/**
  *@generated
  */
  private URL springTemplate;

	/**
  *@generated
  */
  public void setSpringTemplate(URL value){
    
    Object old_value = this.springTemplate;
    
    this.springTemplate = value;
    
    changeSupport.firePropertyChange(K_SPRING_TEMPLATE, old_value, this.springTemplate);
  }

	/**
  *@generated
  */
  public URL getSpringTemplate(){
    
    return this.springTemplate;
  }

	/**
  *@generated
  */
  public static final String K_SPRING_INTEGRATE = "springIntegrate";
	/**
  *@generated
  */
  private boolean springIntegrate;

	/**
  *@generated
  */
  public void setSpringIntegrate(boolean value){
    
    Object old_value = this.springIntegrate;
    
    this.springIntegrate = value;
    
    changeSupport.firePropertyChange(K_SPRING_INTEGRATE, old_value, this.springIntegrate);
  }

	/**
  *@generated
  */
  public boolean getSpringIntegrate(){
    
    return this.springIntegrate;
  }

	/**
  *@generated
  */
  public static final String K_DAO_INTERFACE_TEMPLATES = "daoInterfaceTemplates";
	/**
  *@generated
  */
  private List<URL> daoInterfaceTemplates;

	/**
  *@generated
  */
  public void setDaoInterfaceTemplates(List<URL> value){
     
    if (this.daoInterfaceTemplates != null) this.daoInterfaceTemplates.clear();
    
    this.daoInterfaceTemplates = value;
    
    changeSupport.firePropertyChange(K_DAO_INTERFACE_TEMPLATES, null, this.daoInterfaceTemplates);
  }

	/**
  *@generated
  */
  public List<URL> getDaoInterfaceTemplates(){
    
    if(daoInterfaceTemplates == null){
      daoInterfaceTemplates = new LinkedList<URL>();
    }
    
    return this.daoInterfaceTemplates;
  }

	/**
  *@generated
  */
  public static final String K_DAO_INTERFACE_TEMPLATES_ADD = "daoInterfaceTemplates.insert";
	/**
  *@generated
  */
  public static final String K_DAO_INTERFACE_TEMPLATES_REMOVE = "daoInterfaceTemplates.remove";

	/**
  *@generated
  */
  public void daoInterfaceTemplatesInsert(URL value){
    daoInterfaceTemplates.add(value);
    changeSupport.firePropertyChange(K_DAO_INTERFACE_TEMPLATES_ADD,null,value);
  }

	/**
  *@generated
  */
  public void daoInterfaceTemplatesRemove(URL value){
   daoInterfaceTemplates.remove(value);
   changeSupport.firePropertyChange(K_DAO_INTERFACE_TEMPLATES_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_DAO_IMPL_TEMPLATES = "daoImplTemplates";
	/**
  *@generated
  */
  private List<URL> daoImplTemplates;

	/**
  *@generated
  */
  public void setDaoImplTemplates(List<URL> value){
     
    if (this.daoImplTemplates != null) this.daoImplTemplates.clear();
    
    this.daoImplTemplates = value;
    
    changeSupport.firePropertyChange(K_DAO_IMPL_TEMPLATES, null, this.daoImplTemplates);
  }

	/**
  *@generated
  */
  public List<URL> getDaoImplTemplates(){
    
    if(daoImplTemplates == null){
      daoImplTemplates = new LinkedList<URL>();
    }
    
    return this.daoImplTemplates;
  }

	/**
  *@generated
  */
  public static final String K_DAO_IMPL_TEMPLATES_ADD = "daoImplTemplates.insert";
	/**
  *@generated
  */
  public static final String K_DAO_IMPL_TEMPLATES_REMOVE = "daoImplTemplates.remove";

	/**
  *@generated
  */
  public void daoImplTemplatesInsert(URL value){
    daoImplTemplates.add(value);
    changeSupport.firePropertyChange(K_DAO_IMPL_TEMPLATES_ADD,null,value);
  }

	/**
  *@generated
  */
  public void daoImplTemplatesRemove(URL value){
   daoImplTemplates.remove(value);
   changeSupport.firePropertyChange(K_DAO_IMPL_TEMPLATES_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_SPRING_TEMPLATES = "springTemplates";
	/**
  *@generated
  */
  private List<URL> springTemplates;

	/**
  *@generated
  */
  public void setSpringTemplates(List<URL> value){
     
    if (this.springTemplates != null) this.springTemplates.clear();
    
    this.springTemplates = value;
    
    changeSupport.firePropertyChange(K_SPRING_TEMPLATES, null, this.springTemplates);
  }

	/**
  *@generated
  */
  public List<URL> getSpringTemplates(){
    
    if(springTemplates == null){
      springTemplates = new LinkedList<URL>();
    }
    
    return this.springTemplates;
  }

	/**
  *@generated
  */
  public static final String K_SPRING_TEMPLATES_ADD = "springTemplates.insert";
	/**
  *@generated
  */
  public static final String K_SPRING_TEMPLATES_REMOVE = "springTemplates.remove";

	/**
  *@generated
  */
  public void springTemplatesInsert(URL value){
    springTemplates.add(value);
    changeSupport.firePropertyChange(K_SPRING_TEMPLATES_ADD,null,value);
  }

	/**
  *@generated
  */
  public void springTemplatesRemove(URL value){
   springTemplates.remove(value);
   changeSupport.firePropertyChange(K_SPRING_TEMPLATES_REMOVE,value,null);
  }

	/**
  *@generated
  */
  public static final String K_SPRING_CONFIGURATION = "springConfiguration";
	/**
  *@generated
  */
  private IFile springConfiguration;

	/**
  *@generated
  */
  public void setSpringConfiguration(IFile value){
    
    Object old_value = this.springConfiguration;
    
    this.springConfiguration = value;
    
    changeSupport.firePropertyChange(K_SPRING_CONFIGURATION, old_value, this.springConfiguration);
  }

	/**
  *@generated
  */
  public IFile getSpringConfiguration(){
    
    return this.springConfiguration;
  }

	/**
  *@generated
  */
  public static final String K_SPRING_BEAN_ID = "springBeanId";
	/**
  *@generated
  */
  private String springBeanId;

	/**
  *@generated
  */
  public void setSpringBeanId(String value){
    
    Object old_value = this.springBeanId;
    
    this.springBeanId = value;
    
    changeSupport.firePropertyChange(K_SPRING_BEAN_ID, old_value, this.springBeanId);
  }

	/**
  *@generated
  */
  public String getSpringBeanId(){
    
    return this.springBeanId;
  }

	/**
  *@generated
  */
  public static final String K_DAO_NEED_INTERFACE = "daoNeedInterface";
	/**
  *@generated
  */
  private boolean daoNeedInterface;

	/**
  *@generated
  */
  public void setDaoNeedInterface(boolean value){
    
    Object old_value = this.daoNeedInterface;
    
    this.daoNeedInterface = value;
    
    changeSupport.firePropertyChange(K_DAO_NEED_INTERFACE, old_value, this.daoNeedInterface);
  }

	/**
  *@generated
  */
  public boolean getDaoNeedInterface(){
    
    return this.daoNeedInterface;
  }

	/**
  *@generated
  */
  public static final String K_DAO_CREATE_NEW_INTERFACE = "daoCreateNewInterface";
	/**
  *@generated
  */
  private boolean daoCreateNewInterface;

	/**
  *@generated
  */
  public void setDaoCreateNewInterface(boolean value){
    
    Object old_value = this.daoCreateNewInterface;
    
    this.daoCreateNewInterface = value;
    
    changeSupport.firePropertyChange(K_DAO_CREATE_NEW_INTERFACE, old_value, this.daoCreateNewInterface);
  }

	/**
  *@generated
  */
  public boolean getDaoCreateNewInterface(){
    
    return this.daoCreateNewInterface;
  }

	/**
  *@generated
  */
  public static final String K_DAO_CREATE_NEW_IMPLEMENTATION = "daoCreateNewImplementation";
	/**
  *@generated
  */
  private boolean daoCreateNewImplementation;

	/**
  *@generated
  */
  public void setDaoCreateNewImplementation(boolean value){
    
    Object old_value = this.daoCreateNewImplementation;
    
    this.daoCreateNewImplementation = value;
    
    changeSupport.firePropertyChange(K_DAO_CREATE_NEW_IMPLEMENTATION, old_value, this.daoCreateNewImplementation);
  }

	/**
  *@generated
  */
  public boolean getDaoCreateNewImplementation(){
    
    return this.daoCreateNewImplementation;
  }

	/**
  *@generated
  */
  public static final String K_DAO_INTERFACE_PATH = "daoInterfacePath";
	/**
  *@generated
  */
  private IPath daoInterfacePath;

	/**
  *@generated
  */
  public void setDaoInterfacePath(IPath value){
    
    Object old_value = this.daoInterfacePath;
    
    this.daoInterfacePath = value;
    
    changeSupport.firePropertyChange(K_DAO_INTERFACE_PATH, old_value, this.daoInterfacePath);
  }

	/**
  *@generated
  */
  public IPath getDaoInterfacePath(){
    
    return this.daoInterfacePath;
  }

	/**
  *@generated
  */
  public static final String K_DAO_IMPLEMENTATION_PATH = "daoImplementationPath";
	/**
  *@generated
  */
  private IPath daoImplementationPath;

	/**
  *@generated
  */
  public void setDaoImplementationPath(IPath value){
    
    Object old_value = this.daoImplementationPath;
    
    this.daoImplementationPath = value;
    
    changeSupport.firePropertyChange(K_DAO_IMPLEMENTATION_PATH, old_value, this.daoImplementationPath);
  }

	/**
  *@generated
  */
  public IPath getDaoImplementationPath(){
    
    return this.daoImplementationPath;
  }

	private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
			this);

	public void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener) {
		if (listener instanceof Adapter )
			removeEMFListener(null, (Adapter)listener);
		changeSupport.removePropertyChangeListener(listener);
	}

	public void firePropertyChange(String propertyName, Object oldValue,
			Object newValue) {
		changeSupport.firePropertyChange(propertyName, oldValue, newValue);
	}

	public void addPropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(propertyName, listener);
	}

	private void removeEMFListener(String propertyName,
			Adapter adapter) {
		//iterate each field to find EObject
		Field[] fields = this.getClass().getDeclaredFields();
		for (int i = 0; i < fields.length; i++) {
			Field one_field = fields[i];
			if (EObject.class.isAssignableFrom(one_field.getType())){
				try {
					EObject emf_object = (EObject) one_field.get(this);
					removeEMFListener(emf_object);
				} catch (IllegalArgumentException e) {
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					e.printStackTrace();
				}
			}
		}
	}
	private void addEMFListener(EObject object){
		PropertyChangeListener[] all_listeners = changeSupport.getPropertyChangeListeners();
		List<Adapter> emf_listeners = new LinkedList<Adapter>();
		for (PropertyChangeListener listener : all_listeners){
			if (listener instanceof Adapter){
				emf_listeners.add((Adapter)listener);
			}
		}
		for (Adapter one_adapter : emf_listeners){
			object.eAdapters().add(one_adapter);
		}
	}
	private void removeEMFListener(EObject object){
		if (object == null) return;
		PropertyChangeListener[] all_listeners = changeSupport.getPropertyChangeListeners();
		List<Adapter> emf_listeners = new LinkedList<Adapter>();
		for (PropertyChangeListener listener : all_listeners){
			if (listener instanceof Adapter){
				emf_listeners.add((Adapter)listener);
			}
		}
		for (Adapter one_adapter : emf_listeners){
			object.eAdapters().remove(one_adapter);
		}
	}
	public void removePropertyChangeListener(String propertyName,
			PropertyChangeListener listener) {
		if (listener instanceof Adapter )
			removeEMFListener(propertyName, (Adapter) listener);
		changeSupport.removePropertyChangeListener(propertyName, listener);
		
	}

	// keep a session
	private static BatisSettingModel activeModel;
	
	public static BatisSettingModel newInstance() {
		BatisSettingModel inst = new BatisSettingModel();
		if (activeModel != null) {
			copySettings(activeModel, inst);
		}
		activeModel = inst;
		return inst;
	}
	public static BatisSettingModel getActiveModel() {
		//for design time, must return an instance.
		if (activeModel == null){
			activeModel = BatisSettingModel.newInstance();
		}
		return activeModel;
	}
	public IJavaProject getCurrentProject(){
		assert (configurationFile != null);
		return JavaCore.create(configurationFile.getProject());
	}
	private static void copySettings(BatisSettingModel old,
			BatisSettingModel fresh) {
		if (old.getConfigurationFile() != null){
			fresh.setConfigurationFile(old.getConfigurationFile());
			if (old.getSqlmapFile() != null){
				fresh.setSqlmapFile(old.getSqlmapFile());
			}
			if (old.getDaoNeedInterface()){
				fresh.setDaoNeedInterface(true);
			}
			if (old.getDaoInterfacePath() != null){
				fresh.setDaoInterfacePath(old.getDaoInterfacePath());
			}
			if (old.getDaoInterfaceTemplate() != null){
				fresh.setDaoInterfaceTemplate(old.getDaoInterfaceTemplate());
			}
			if (old.getDaoImplementationPath() != null){
				fresh.setDaoImplementationPath(old.getDaoImplementationPath());
			}
			if (old.getDaoImplTemplate() != null){
				fresh.setDaoImplTemplate(old.getDaoImplTemplate());
			}
		}
		
		if (old.getBeanTemplate() != null){
			fresh.setBeanTemplate(old.getBeanTemplate());
		}
		
		
	}
	private INamingConversion namingConversion = new DefaultNamingConversion();
	public INamingConversion getNamingConversion(){
		return namingConversion;
	}
	private BatisSettingModel() {

	}
}